package org.text2diagram.ddl.domain;

public class Link {

	public enum LinkDirection {
		DIRECT,
		REVERSE,
		BIDIRECT,
		NONE
	}
	
	public enum LinkStyle {
		SOLID,
		DASHED
	}
	
	
	private Block source;
	private Block target;
	private LinkDirection direction;
	private LinkStyle style;
	private String text;
	private Group group;
	
	public Link(Block source, Block target, LinkDirection direction, LinkStyle style, String text) {
		super();
		this.source = source;
		this.target = target;
		this.direction = direction;
		this.style = style;
		this.text = text;
	}
	
	@Override
	public String toString() {
		return String.format("Link(direction: %s, style: %s, text: %s, sourceName: %s, targetName: %s)", direction, style, text, source.getName(), target.getName());
	}	

	public Block getSource() {
		return source;
	}
	
	public void setSource(Block source) {
		this.source = source;
	}
	
	public Block getTarget() {
		return target;
	}
	
	public void setTarget(Block target) {
		this.target = target;
	}
	
	public LinkDirection getDirection() {
		return direction;
	}
	
	public void setDirection(LinkDirection direction) {
		this.direction = direction;
	}
	
	public LinkStyle getStyle() {
		return style;
	}
	
	public void setStyle(LinkStyle style) {
		this.style = style;
	}
	
	public String getText() {
		return text;
	}
	
	public void setText(String text) {
		this.text = text;
	}

	public void setGroup(Group group) {
		this.group = group;
	}

	public Group getGroup() {
		return group;
	}	
	
}
